<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<s:actionmessage/>
<s:actionerror/>
<div class="form_button">

</div>
<s:if test="listUserEntity.size() > 0">
	<div class="content">
	<table class="userTable" cellpadding="5px">
		<tr class="even">
			<th>#</th>
			<th>Tài khoản</th>
			<th>Họ và tên</th>
			<th>Ngày sinh</th>
			<th>Giới tính</th>
			<th>Địa chỉ</th>
			<th>Quyền sử dụng</th>
			<th>Ngày đăng ký</th>
			<th>Ngày cập nhật</th>
			<th>Hành động</th>
		</tr>
		<s:iterator value="listUserEntity" status="userStatus">
			<tr
				class="<s:if test="#userStatus.odd == true ">odd</s:if><s:else>even</s:else>">
				<td><s:property value="userId" /></td>
				<td><s:property value="userName" /></td>
				<td><s:property value="fullName" /></td>
				<td><s:date name="birthday" format="dd/MM/yyyy" /></td>
				<td><s:property value="gender" /></td>
				<td><s:property value="address" /></td>
				<td>
					<s:if test="role==1">
						Admin
					</s:if>
					<s:else>
						Giáo viên
					</s:else>
				</td>
				<td><s:date name="createDate" format="dd/MM/yyyy" /></td>
				<td><s:date name="updateDate" format="dd/MM/yyyy" /></td>
				<td colspan="3"><s:url id="viewURL" action="viewUser">
					<s:param name="userId" value="%{userId}"></s:param>
				</s:url> <s:a href="%{viewURL}">View</s:a> |
				<s:url id="editURL" action="editUser">
					<s:param name="userId" value="%{userId}"></s:param>
				</s:url> <s:a href="%{editURL}">Edit</s:a> | 
				<s:url id="deleteURL" action="deleteUser">
					<s:param name="userId" value="%{userId}"></s:param>
				</s:url> <s:a href="%{deleteURL}">Delete</s:a>
			</tr>
		</s:iterator>
	</table>
	</div>
</s:if>
<s:a href="addUser.action">Add User</s:a>
<s:a href="default.action">Home</s:a>
